package com.mapper;

//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.domain.Stu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface StuMapper extends BaseMapper<Stu> {
    @Select("select * from stu")
    public List<Stu> findAll();
    @Select("select * from stu where username = #{name}")
    public List<Stu> findByName(String name);
    @Insert("insert into stu(username,pass,java,math,os) values(#{username},#{pass},#{java},#{math},#{os}) ")
    public void add(Stu stu);
    @Delete("delete from stu where id = #{id}")
    public void deleteById(Long id);
}
